<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .outter {
            display: flex;
            justify-content: center;
            /* 主轴居中对齐，默认为水平居中 */
            align-items: center;
            /* 交叉轴居中对齐，默认垂直居中 */

            width: 400px;
            height: 400px;
            background-color: beige;
        }

        .inner {
            width: 200px;
            height: 200px;
            background-color: cadetblue;
        }
    </style>
</head>

<body>
    <div class="outter">
        <div class="inner">
            内部盒子
        </div>
    </div>
</body>

</html>